package ar.edu.utn.frba.dds.fechas;

public class Fecha {

		private int date;
		private int month;
		private int year;
		
		public Fecha () { 
			super();
		}
		
		
		public Fecha (int year, int month, int date) {
			this.year = year;
			this.month = month;
			this.date = date;
		}
		
		public Fecha (String[] vector) {
			this.year = Integer.parseInt(vector[0]);
			this.month = Integer.parseInt(vector[1]);
			this.date = Integer.parseInt(vector[2]);
		}
		
		public int getDate() {
			return this.date;
		}
		public int getMonth() {
			return this.month;
		
		}
		public int getYear() {
			return this.year;
		}
							
		public void setDate(int date) {
			this.date = date;
			}
			
		public void setMonth(int month) {
			this.month = month ;
			}
			
		public void setYear(int year) {
			this.year = year;
		}
		
		public String anteriorA (Fecha fecha) {
			if ((fecha.getYear()< this.year) || (fecha.getYear() == this.year  && fecha.getMonth() < this.month) || (fecha.getYear() == this.year  && fecha.getMonth() == this.month && fecha.getDate()< this.date)) {
				return "Soy anterior";	
			}
			else {
				return "No soy anteriro";
			}
		}
}